Completed
Push — master ( 4fcad4...efcce7 )
by Muhammad Dyas
19s queued 16s
created

BaseHandler   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 6
eloc 11
dl 0
loc 13
rs 10
c 0
b 0
f 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A getAnnotations 0 3 5
A process 0 2 1
1
import {chat_v1 as chatV1} from 'googleapis/build/src/apis/chat/v1';
2
3
export default abstract class BaseHandler {
4
  protected event: chatV1.Schema$DeprecatedEvent;
5
6
  constructor(event: chatV1.Schema$DeprecatedEvent) {
7
    this.event = event;
8
  }
9
10
  protected getAnnotations(): chatV1.Schema$Annotation[] {
11
    return this.event?.message?.annotations ?? [];
12
  }
13
14
  public abstract process(): chatV1.Schema$Message | Promise<chatV1.Schema$Message>;
15
}
16